package com.itheima;

public class Test5 {
    public static void main(String[] args) {
        int []arr={3,5,2,6,1};
        int num=2;
        boolean exist=exist(arr,num);
        if (exist==true){
            System.out.println("包含");
        }else {
            System.out.println("不包含");
        }
    }
    public static boolean exist(int[] arr, int num){
        for (int i = 0; i < arr.length; i++) {
            if (arr[i]==num){
                return true;
            }
        }
        return false;
    }
}
